package com.bw.zcb.mvp.view.people;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.bw.zcb.R;
import com.bw.zcb.mvp.view.people.adapter.PeopleVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;

/**
 * A simple {@link Fragment} subclass.
 */
public class PeopleFragment extends Fragment {

    private View rootView;
    private SlidingTabLayout peopleTab;
    private ViewPager peopleVp;
    private PeopleVpAdapter adapter;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_people, container, false);
        init();
        return rootView;

    }

    private void init() {
        peopleTab = rootView.findViewById(R.id.people_tab);
        peopleVp = rootView.findViewById(R.id.people_vp);
        adapter = new PeopleVpAdapter(getFragmentManager());
        peopleVp.setAdapter(adapter);
        peopleTab.setViewPager(peopleVp);
    }
}
